package com.cskaoyan.market.controller.admin;

import com.cskaoyan.market.annotation.RequiresPermissionsDesc;
import com.cskaoyan.market.db.domain.MarketSearchHistory;
import com.cskaoyan.market.service.AdminHistoryService;
import com.cskaoyan.market.util.ResponseUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServlet;
import java.io.IOException;
import java.util.List;


@RestController
@RequestMapping("/admin/history")
public class AdminHistoryController extends HttpServlet {

    @Autowired
    AdminHistoryService adminHistoryService ;




    @GetMapping("list")
    @RequiresPermissions("admin:history:list")
    @RequiresPermissionsDesc(menu = {"会员管理", "搜索历史"},button = "查询")
    public Object list(Integer page,Integer limit,Integer userId,String keyword,String sort,String order) {

        List<MarketSearchHistory> marketSearchHistoryList= adminHistoryService.list(page,limit,userId,keyword,sort,order);
        return ResponseUtil.okList(marketSearchHistoryList);
    }
}
